<?php
/*
Version 0.1
SEMF - Web Desiging Framework for Sport Event Managment
Copyright (C) 2006, SEMF Developers

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

*/

class token
{
	public static $NOT_A_TOKEN = -1;
	
	public static $VARIABLE = 1;
	public static $CONSTANT = 2; //for the string const..
	public static $NUMBER = 3; //for the string const..
	public static $DATA_VAR = 4;
	public static $SYS_VAR = 5;
	
	//operators
	public static $SEMI_COL = 10;
	public static $EQUAL = 11;
	public static $EQUILITY = 12;
	public static $LESS_THAN = 13;
	public static $GREATER_THAN = 14;
	public static $OR = 15;
	public static $AND = 16;
	public static $OPEN_BLOCK = 17;
	public static $CLOSE_BLOCK = 18;
	public static $DOT = 19;
	public static $OPEN_BRACKET = 20;
	public static $CLOSE_BRACKET = 21;
	public static $LESS_THAN_EQUAL = 22;
	public static $GREATER_THAN_EQUAL = 23;
	public static $COMMA = 24;
	public static $NOT_EQUILITY = 25;
	public static $NOT_EXPR = 26;
	
	
	public static $ADD = 50;
	public static $SUB = 51;
	public static $MUL = 52;
	public static $DIV = 53;
	
	public static $ADD_EQUAL = 54;
	public static $SUB_EQUAL = 55;
	public static $MUL_EQUAL = 56;
	public static $DIV_EQUAL = 57;
	
	public static $ADD_ADD = 58; //++ operator
	public static $SUB_SUB = 59; //-- operator
	
	//keywords
	public static $IF = 30;
	public static $ELSE = 31;
	public static $ELSEIF = 32;
	public static $THIS = 33;
	public static $THIS_USER = 34;
	public static $THIS_MODULE = 35;
	public static $THIS_TIME = 36;
	public static $NULL = 37;
	
	
	//databases
	public static $SELECT = 70;
	public static $DECL = 71;
	public static $WHERE = 72;
	public static $FROM = 73;
	public static $NEW = 74;
	public static $DELETE = 75;

	public $type;
	public $value;
	
	//TODO: line number and cel number
	public $line_no;
	public $col_no;
	
	public function __construct($type, $value, $line_no, $col_no)
	{
		$this-> type = $type;
		$this-> value = $value;
		$this-> line_no = $line_no;
		$this-> col_no = $col_no;
	}	
}

?>
